<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <title>趣订水管理平台</title>
    <link href="/favicon.ico" type="image/x-icon" rel="shortcut icon">
    <meta name="csrf-token" content="{{ csrf_token() }}">
    <link rel="stylesheet" type="text/css" href="/admin/css/base.css" media="all">
    <link rel="stylesheet" type="text/css" href="/admin/css/common.css" media="all">
    <link rel="stylesheet" type="text/css" href="/admin/css/module.css">
    <link rel="stylesheet" type="text/css" href="/admin/css/style.css" media="all">
    <link rel="stylesheet" type="text/css" href="/admin/css/{{$config['COLOR_STYLE']}}.css" media="all">
    <!--[if lt IE 9]>
    <script type="text/javascript" src="/static/jquery-1.10.2.min.js"></script>
    <![endif]--><!--[if gte IE 9]><!-->
    <script type="text/javascript" src="/static/jquery-2.0.3.min.js"></script>
    <script type="text/javascript" src="/static/layer/layer.js"></script>
    <script type="text/javascript" src="/admin/js/common.js"></script>
    <script type="text/javascript" src="/admin/js/jquery.mousewheel.js"></script>
    <style>
        #marquee{
            line-height: 40px;
            background-color:rgba(5, 5, 5, 0.4)!important;
            color:yellow;
            font-size: 20px;
        }
    </style>
    @yield('head')
    <script>
        $.ajaxSetup({
            headers: {
                'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
            }
        });
    </script>
    <!--<![endif]-->
    @yield('style')
</head>
<body>
@if(!isset($hideHeader))
<!-- 头部 -->
<div class="header">
    <!-- Logo -->
    <span class="logo"></span>
    <!-- /Logo -->
    <!-- 主导航 -->
    <ul class="main-nav">
        @if(isset($menus['top']))
            @foreach($menus['top'] as $v)
                <li class="{{checkMenuInRules($v['rules'])}}"><a
                            href="{{getAdminUrl($v['rules'][0])}}">{{$v['title']}}</a>
                </li>
            @endforeach
        @endif
    </ul>
    <!-- /主导航 -->

    <!-- 用户栏 -->
    <div class="user-bar">
        <a href="javascript:;" class="user-entrance"><i class="icon-user"></i></a>
        <ul class="nav-list user-menu hidden">
            <li class="manager">你好，<em
                        title="{{admin_name()}}">{{admin_name()}}</em></li>
            @if(session('platIdentify') == 'admin')
                <li><a href="{{urlAdmin('admin','getEditPassword')}}">修改密码</a></li>
            @else
                <li><a href="javascript:;" onclick="showQr()">收款提示</a></li>
                <li><a href="{{urlAccount('single','getAccount')}}">修改密码</a></li>
            @endif
            @if(session('platIdentify') == 'admin')<li><a href="{{urlPlat('admin','getEditNickname')}}">修改昵称</a></li>@endif
            <li><a href="{{urlPlat('login','getLogout')}}">退出</a></li>
        </ul>

    </div>
</div>
<!-- /头部 -->

<!-- 边栏 -->
<div class="sidebar">
    <!-- 子导航 -->
    <div id="subnav" class="subnav">
    <input type="hidden" id="main_member_url" value="{{session('shop_info') ? urlPlat('Single','getMember') : urlPlat('Member','getIndex')}}">
    @if(isset($menus['left']))
        @foreach($menus['left'] as $v)
            <!-- 子导航 -->
                @if(checkMenuInRules($v['rules']))
                    @foreach($v['data'] as $key=>$m)
                        @if($key)
                            <h3><i class="icon icon-unfold"></i>{{$key}}</h3>
                            <ul class="side-sub-menu">
                                @foreach($m as $n)
                               {{--<span style="color: yellow"> {{$n['url']}} <span style="color: red"> {{checkMenuInRules($n['rules'],$n['url'])}}</span></span><br>--}}
                                    <li class="{{checkMenuInRules($n['rules'],$n['url'])}}">
                                        <a class="item" href="{{getAdminUrl($n['url'])}}">
                                            @if($n['url'] == 'single/shop')
                                                @if(plat_identify() == 'admin')
                                                    店铺列表
                                                @else
                                                    我的店铺
                                                @endif
                                            @else
                                                {{$n['title']}}
                                            @endif
                                        </a>
                                    </li>
                                @endforeach
                            </ul>
                        @endif
                    @endforeach
                @endif
            <!-- /子导航 -->
            @endforeach
        @endif
    </div>
    <!-- /子导航 -->
</div>
<!-- /边栏 -->
@if(session('show_notice'))
<div>
    <marquee id="marquee" direction=left behavior=scroll loop=-1 scrollamount=8 scrolldelay=0 bgcolor=#ccffff height=40 width=100% hspace=0 vspace=0
             onmouseover=this.stop() onmouseout=this.start()>您的店铺即将到期，为避免影响使用，请及时续费。续费入口：店铺管理->我的店铺->右侧续费按钮</marquee>
</div>
@endif
@endif
<!-- 内容区 -->
<div id="main-content">
    <div id="top-alert" class="fixed alert alert-error" style="display: none;">
        <button class="close fixed" style="margin-top: 4px;">&times;</button>
        <div class="alert-content">这是内容</div>
    </div>
    <div id="main" class="main">


        {{--<block name="nav">--}}
        {{--<!-- nav -->--}}
        {{--<notempty name="_show_nav">--}}
        {{--<div class="breadcrumb">--}}
        {{--<span>您的位置:</span>--}}
        {{--<assign name="i" value="1"/>--}}
        {{--<foreach name="_nav" item="v" key="k">--}}
        {{--<if condition="$i eq count($_nav)">--}}
        {{--<span>{$v}</span>--}}
        {{--<else/>--}}
        {{--<span><a href="{$k}">{$v}</a>&gt;</span>--}}
        {{--</if>--}}
        {{--<assign name="i" value="$i+1"/>--}}
        {{--</foreach>--}}
        {{--</div>--}}
        {{--</notempty>--}}
        {{--<!-- nav -->--}}
        {{--</block>--}}
        @yield('body')
    </div>
    @if(!isset($hideHeader))
        <div class="cont-ft">
            <div class="copyright">
                <div class="fl">感谢使用<a href="{{url('/')}}" target="_blank">趣订水</a>管理平台</div>
                <div class="fr"></div>
            </div>
        </div>
    @endif
</div>
<!-- /内容区 -->
<script type="text/javascript" src="/admin/js/basePhone.js"></script>
<script type="text/javascript">
    +function () {
        var $window = $(window), $subnav = $("#subnav"), url;
        $window.resize(function () {
            $("#main").css("min-height", $window.height() - 130);
        }).resize();

        /* 左边菜单高亮 */
//        url = window.location.pathname + window.location.search;
//        url = url.replace(/(\/(p)\/\d+)|(&p=\d+)|(\/(id)\/\d+)|(&id=\d+)|(\/(group)\/\d+)|(&group=\d+)/, "");
//        $subnav.find("a[href='" + url + "']").parent().addClass("current");

        /* 左边菜单显示收起 */
        $("#subnav").on("click", "h3", function () {
            var $this = $(this);
            $this.find(".icon").toggleClass("icon-fold");
            $this.next().slideToggle("fast").siblings(".side-sub-menu:visible").prev("h3").find("i").addClass("icon-fold").end().end().hide();
        });

        $("#subnav h3 a").click(function (e) {
            e.stopPropagation()
        });

        /* 头部管理员菜单 */
        $(".user-bar").mouseenter(function () {
            var userMenu = $(this).children(".user-menu ");
            userMenu.removeClass("hidden");
            clearTimeout(userMenu.data("timeout"));
        }).mouseleave(function () {
            var userMenu = $(this).children(".user-menu");
            userMenu.data("timeout") && clearTimeout(userMenu.data("timeout"));
            userMenu.data("timeout", setTimeout(function () {
                userMenu.addClass("hidden")
            }, 100));
        });

        /* 表单获取焦点变色 */
        $("form").on("focus", "input", function () {
            $(this).addClass('focus');
        }).on("blur", "input", function () {
            $(this).removeClass('focus');
        });
        $("form").on("focus", "textarea", function () {
            $(this).closest('label').addClass('focus');
        }).on("blur", "textarea", function () {
            $(this).closest('label').removeClass('focus');
        });

        // 导航栏超出窗口高度后的模拟滚动条
        var sHeight = $(".sidebar").height();
        var subHeight = $(".subnav").height();
        var diff = subHeight - sHeight; //250
        var sub = $(".subnav");
        if (diff > 0) {
            $(window).mousewheel(function (event, delta) {
                if (delta > 0) {
                    if (parseInt(sub.css('marginTop')) > -10) {
                        sub.css('marginTop', '0px');
                    } else {
                        sub.css('marginTop', '+=' + 10);
                    }
                } else {
                    if (parseInt(sub.css('marginTop')) < '-' + (diff - 10)) {
                        sub.css('marginTop', '-' + (diff - 10));
                    } else {
                        sub.css('marginTop', '-=' + 10);
                    }
                }
            });
        }
    }();

    function showQr() {
        layer.open({
            type: 2,
            title: '收款提示',
            area: ['40%','60%'],
            fixed: false,
            content: "{{urlAccount('single', 'getReceiveQr')}}"
        });
    }
</script>
@yield('script')
</body>
</html>
